package away3d.events ;


import away3d.library.assets.IAsset ;
import flash.events.Event ;



class AssetEvent extends Event
{
    
    
    public static inline var ASSET_COMPLETE             : String = 'assetComplete' ;
    public static inline var MESH_COMPLETE              : String = 'meshComplete' ;
    public static inline var GEOMETRY_COMPLETE          : String = 'geometryComplete' ;
    public static inline var SKELETON_COMPLETE          : String = 'skeletonComplete' ;
    public static inline var SKELETON_POSE_COMPLETE     : String = 'skeletonPoseComplete' ;
    public static inline var CONTAINER_COMPLETE         : String = 'containerComplete' ;
    public static inline var ANIMATION_COMPLETE         : String = 'animationComplete' ;
    public static inline var BITMAP_COMPLETE            : String = 'bitmapComplete' ;
    public static inline var MATERIAL_COMPLETE          : String = 'materialComplete' ;
    public static inline var ANIMATOR_COMPLETE          : String = 'animatorComplete' ;
    public static inline var ASSET_RENAME               : String = 'assetRename' ;
    public static inline var ASSET_CONFLICT_RESOLVED    : String = 'assetConflictResolved' ;
    private var _asset                                  : IAsset ;
    private var _prevName                               : String ;
    
    
    
    public function new (   type        : String
                        ,   ?asset      : IAsset = null
                        ,   _prevName   : String = null
                        )
    {
        
        super( type ) ;
        
        _asset      = asset ;
        _prevName   = prevName || ( _asset? _asset.name : null ) ;
        
    }
    
    
    public var asset( get_asset, null ) : IAsset ;
    
    
    private function get_asset() : IAsset
    {
        
        return _asset ;
        
    }
    
    
    public var assetPrevName( get_assetPrevName, null ) : String ;
    
    
    private function get_assetPrevName() : String
    {
        
        return _prevName ;
        
    }
    
    
    public override function clone() : Event
    {
        
        return new AssetEvent( type, asset, assetPrevName ) ;
        
    }
    
    
}